package com.dao.rxjava01.uis.activities;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.util.Log;
import android.view.View;

import com.dao.green.cn.applibary.uis.BaseActivity;
import com.dao.rxjava01.R;
import com.dao.rxjava01.beans.UserBean;
import com.dao.rxjava01.databinding.ActivityMainBinding;

public class MainActivity extends BaseActivity {
    private ActivityMainBinding binding;

    @Override
    public void bindLayout() {
        binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
    }

    @Override
    public void initView() {

    }

    @Override
    public void initData() {
        binding.setUser(new UserBean());
    }

    @Override
    public void initListener() {
        binding.setPresenter(new MainPresenter());
    }


    public class MainPresenter implements View.OnClickListener {

        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.acMainObt:
                    Log.i("TAG", "obt onClicked");
                    startActivity(new Intent(MainActivity.this, Demo01.class));
                    break;
            }
        }
    }
}
